﻿using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DatabaseAccess;
using System.Data;
using System.Text;

namespace Liguo.Administration
{
    public partial class ImitateOrders : System.Web.UI.Page
    {
     
        Dictionary<String, String> imiOrdDic_1;
        Dictionary<String, String> imiOrdDic_2;

        SqlIt imiOrdSql = new SqlIt();

        protected void Page_Load(object sender, EventArgs e)
        {           
                
        }

        protected void ButtonSubmit_Clicked(object sender, EventArgs e)
        {
            //第一步：获取有关属性    
            imiOrdDic_1 = new Dictionary<string, string>();
            imiOrdDic_2 = new Dictionary<string, string>();

            string userID_1 = TextUserID_1.Text.Trim();
            string time_1 = TextTime_1.Text;
            string remark_1 = TextRemark_1.Text.Trim();
            string userID_2 = TextUserID_2.Text.Trim();
            string time_2 = TextTime_2.Text;
            string remark_2 = TextRemark_2.Text.Trim();
            
            //第二步：将两条订单添加到数据库中表OrderInfo
            imiOrdDic_1["UserID"] = userID_1;
            imiOrdDic_1["Time"] = time_1;
            imiOrdDic_1["Remark"] = remark_1;
            imiOrdDic_1["Status"] = "1";

            imiOrdDic_2["userID"] = userID_2;
            imiOrdDic_2["Time"] = time_2;
            imiOrdDic_2["Remark"] = remark_2;
            imiOrdDic_2["Status"] = "1";

            imiOrdSql.AddMess("OrderInfo", imiOrdDic_1);
            imiOrdSql.AddMess("OrderInfo", imiOrdDic_2);     
            
            Response.Write("<script type='text/javascript'>alert('添加订单成功！');</script>");
            return;
        }
        protected void ButtonClear_Clicked(object sender, EventArgs e)
        {
            ClearAll();
        }
        private void ClearAll()
        {
            TextUserID_1.Text = "";
            TextTime_1.Text = "";
            TextRemark_1.Text = "";
            TextUserID_2.Text = "";
            TextTime_2.Text = "";
            TextRemark_2.Text = "";
        }
    }
}
